import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:extended_text_field/extended_text_field.dart';
import 'package:whale/helper/utils/util.dart';
import 'package:whale/pages/msg_page/sub/rich_text_field_demo/widgets/emoji.dart';
import '../index.dart';

class RichTextField extends StatefulWidget {
  const RichTextField({super.key});

  @override
  State<RichTextField> createState() => _RichTextFieldState();
}

class _RichTextFieldState extends State<RichTextField> {
  late final editCtrl = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ExtendedTextField(
        controller: editCtrl,
        style: TextStyle(color: const Color(0xff333333), fontSize: 15.sp),
        maxLines: null,
        specialTextSpanBuilder: EmojiSpanBuilder(editCtrl, context),
      ),
    );
  }
}
